package cn.rkylin.oms.base.channel.service;

import cn.rkylin.oms.base.channel.vo.MdmRecords;
import com.github.pagehelper.PageInfo;

import cn.rkylin.oms.base.brand.domain.Brand;
import cn.rkylin.oms.base.brand.vo.BrandVO;
import cn.rkylin.oms.base.channel.domain.Channel;
import cn.rkylin.oms.base.channel.vo.ChannelVO;

import java.util.List;

/**
 * 渠道Service
 */
public interface IChannelService {

	/**
	 * 查询渠道列表
	 * 
	 * @param page
	 *            页号
	 * @param rows
	 *            页大小
	 * @param channelVO
	 *            渠道VO
	 * @return 渠道列表
	 * @throws Exception
	 *             异常
	 */
	
	public PageInfo findByWhere(int page, int rows, ChannelVO channelVO) throws Exception;

	/**
	 * 下载渠道
	 * 
	 * @param page
	 *            页号
	 * @param rows
	 *            页大小
	 * @return 返回结果
	 * @throws Exception
	 *             异常
	 */
	public String downloadChannel(int page, int rows) throws Exception;

	/**
	 * 接受主动发过来的数据变更
	 * 
	 * @param json
	 *            JSON
	 * @param type
	 *            类型
	 * @throws Exception
	 *             异常
	 */
	public List<MdmRecords> receiveChannel(String json, String type) throws Exception;

	/**
	 * 接受主动发过来的数据变更(新)
	 *
	 * @param json
	 *            JSON
	 * @param type
	 *            类型
	 * @throws Exception
	 *             异常
	 */
	public List<String> receiveChannelNew(String json, String type) throws Exception;
	
	/**
     * 插入
     * 
     * @param channelVO
     * @return
     * @throws Exception
     */
    public Channel insert(ChannelVO channelVO) throws Exception;
    
    /**
     * 获取ID
     * 
     * @param id
     * @return
     * @throws Exception
     */
    public ChannelVO getChannelById(String id) throws Exception;
	
	/**
     * 获取code
     * 
     * @param id
     * @return
     * @throws Exception
     */
    public ChannelVO getChannelByChannelCode(ChannelVO channelVO) throws Exception;
    
    /**
     * 修改
     * 
     * @param channelVO
     * @return
     * @throws Exception
     */
    public Channel update (ChannelVO channelVO) throws Exception;
    
	/**
	 * 删除
	 * 
	 * @param channelID
	 * @return
	 * @throws Exception
	 */
	public int delete(String channelID) throws Exception;

}
